import request from '@/utils/request'
/**
 *查询全部
 *params datas object
 */
export function queryList(datas) {
  return request({
    url: '/smc/api/userinfo',
    method: 'get', // get+params？后面有多参数
    params: {
      projectList: datas.queryArr,
      pageSize: datas.pageSize,
      pageNum: datas.pageNum
    }
  })
}
export function resetpassword(userid) {
  return request({
    url: '/smc/api/resetpassword/' + userid,
    method: 'get'
  })
}
// 修改数据 dataset object
export function update(datas) {
  return request({
    url: '/smc/api/userinfo',
    method: 'put',
    data: { // data,
      userid: datas.userid,
      login: datas.login,
      pw: datas.pw,
      username: datas.username,
      userno: datas.userno,
      orgid: datas.orgid,
      birthday: datas.birthday,
      sex: datas.sex,
      nativeplace: datas.nativeplace,
      telephone: datas.telephone,
      zjmm: datas.zjmm,
      headship: datas.headship,
      fax: datas.fax,
      email: datas.email,
      extend1: datas.extend1,
      extend2: datas.extend2,
      extend3: datas.extend3,
      extend4: datas.extend4,
      bz: datas.bz,
      status: datas.status
    }
  })
}
// 删除/批量删除  在不同操作下 ids 分别为 变量 或Array
export function deletes(userid) {
  return request({
    url: '/smc/api/userinfos/' + userid,
    method: 'get' // post+params,?后面有1参数
  })
}
// 新增  dataset object
export function add(datas) {
  console.log(datas)
  return request({
    url: '/smc/api/userinfo',
    method: 'post',
    data: {
      projectName: datas.projectName,
      deptId: datas.deptId,
      typeId: datas.typeId,
      deptName: datas.deptName,
      typeName: datas.typeName,
      createType: datas.createType,
      buildStatus: datas.buildStatus,
      buildApprovalProblem: datas.buildApprovalProblem,
      planStatus: datas.planStatus,
      planApprovalProblem: datas.planApprovalProblem,
      areaStatus: datas.areaStatus,
      areaApprovalProblem: datas.areaApprovalProblem,
      envStatus: datas.envStatus,
      envApprovalProblem: datas.envApprovalProblem,
      elseProblem: datas.elseProblem,
      needDeptProblem: datas.needDeptProblem,
      createUser: datas.createUser,
      createTel: datas.createTel,
      createTime: datas.createTime,
      updateUser: datas.updateUser,
      updateTel: datas.updateTel,
      updateTime: datas.updateTime,
      buildOverTime: datas.buildOverTime,
      buildApprovalNum: datas.buildApprovalNum,
      buildLicenseNum: datas.buildLicenseNum,
      buildNode: datas.buildNode,
      planOverTime: datas.planOverTime,
      planApprovalNum: datas.planApprovalNum,
      planLicenseNum: datas.planLicenseNum,
      planNode: datas.planNode,
      areaOverTime: datas.areaOverTime,
      areaApprovalNum: datas.areaApprovalNum,
      areaLicenseNum: datas.areaLicenseNum,
      areaNode: datas.areaNode,
      envOverTime: datas.envOverTime,
      envApprovalNum: datas.envApprovalNum,
      envLicenseNum: datas.envLicenseNum,
      envNode: datas.envNode,
      actPermission: datas.actPermission
    }
  })
}
